package com.local.web.service;

import com.local.cart.pojo.ShoppingCart;
import com.local.common.util.ResultUtil;
import org.springframework.session.Session;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface ShoppingCartService {

    /**
     * 查询用户的购物车列表
     * @param userId
     * @return
     */
    public List<ShoppingCart> getListByUserId(HttpSession session, Integer userId);


    /**
     * 加入购物车
     * @param cart
     * @return
     */
    public ResultUtil addToCart(HttpSession session, ShoppingCart cart);

    /**
     * 根据cartItemId从购物车列表中删除数据
     * @param cartItemId
     * @return
     */
    public ResultUtil deleteByCartItemId(HttpSession session, Integer cartItemId);

    /**
     * 在购物车页面，修改商品数量
     * @param shoppingCart
     * @return
     */
    public ResultUtil updateGoodsCount(HttpSession session, ShoppingCart shoppingCart);
}
